feat(network): support --aux-address on network create#5041
feat(network): support --aux-address on network create#5041mayur-tolexo wants to merge 1 commit into
Conversation
08a26ea to
d6ab811
Compare
|
Checked Docker: nerdctl with this PR: host-local has no exclude list, so the reservation is enforced by splitting the range around each reserved IP; those addresses are then never handed out. With |
4869592 to
96aef29
Compare
Docker's network create reserves auxiliary addresses so IPAM never hands them out to containers. nerdctl had no equivalent. host-local has no exclude list, but it allocates across every range in a set, so each reserved IP is carved out by splitting the subnet range around it. The reserved name=IP pairs are matched to the subnet that contains them (so dual-stack picks the right family), rejected when they hit the network or gateway address or fall outside every subnet, and recorded so network inspect reports AuxiliaryAddresses the same way Docker does. Signed-off-by: Mayur Das <[email protected]>
96aef29 to
8400fe2
Compare
|
cc @AkihiroSuda — rebased on latest main and green, could you take a look when you get a chance? |
| // host-local does not read it (reservation is done by splitting the range | ||
| // around each IP); it is nerdctl bookkeeping so `network inspect` can | ||
| // report AuxiliaryAddresses the way Docker does. | ||
| AuxiliaryAddresses map[string]string `json:"auxiliaryAddresses,omitempty"` |
There was a problem hiding this comment.
Doesn't seem implemented in CNI
https://github.com/containernetworking/plugins/blob/v1.9.1/plugins/ipam/host-local/backend/allocator/config.go#L68
nerdctl-specific information could be stored in NerdctlLabels
https://github.com/search?q=repo%3Acontainerd%2Fnerdctl+NerdctlLabels&type=code
There was a problem hiding this comment.
Part of #5012.
Docker's network create reserves auxiliary addresses so IPAM never hands them out to containers. nerdctl had no equivalent.
host-local has no exclude list, but it allocates across every range in a set, so each reserved IP is carved out by splitting the subnet range around it. The reserved name=IP pairs are matched to the subnet that contains them (so dual-stack picks the right family), rejected when they hit the network or gateway address or fall outside every subnet, and recorded so network inspect reports AuxiliaryAddresses the same way Docker does.